<template>
  <div class="page">
    <!-- 左侧导航 -->
    <div class="sidebar-menu fixed">
      <div class="sticky sidebar-nav fade">
        <div class="modal-dialog h-100  sidebar-nav-inner">
          <div class="sidebar-logo border-bottom border-color">
            <!-- logo -->
            <div class="logo overflow-hidden">
              <!-- <h1 class="text-hide position-absolute">双语导航</h1> -->
              <a href="https://nav.iowen.cn"
                 class="logo-expanded">
                <img src="../assets/logo1.png"
                     class="logo-light"
                     alt="双语导航">
                <!-- <img src="../assets/logo.png" height="40" class="logo-dark d-none" alt="双语导航"> -->
                <div class="logo-content">
                  <span class="logo-title">双语导航</span>
                  <!-- <span class="logo-sub-title">为导航而生</span> -->
                </div>
              </a>
            </div>
            <!-- logo end -->
          </div>
          <div class="flex-fill">
            <div class="sidebar-scroll">
              <NavList></NavList>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 右侧 -->
    <div class="main-content">
      <!-- 顶部导航 -->
      <nav class="navbar user-info-navbar"
           role="navigation">
        <div class="navbar-content">
          <ul class="user-info-menu list-inline list-unstyled">
            <li class="hidden-xs">
              <a href="#"
                 data-toggle="sidebar">
                <i class="fa fa-bars"></i>
              </a>
            </li>
          </ul>
        </div>
      </nav>
      <div class="no-search"></div>
      <!-- 内容区域 -->
      <div class="sites-list">
        <Item></Item>
      </div>
    </div>
  </div>
  <el-backtop :right="100"
              :bottom="100" />
</template>

<script setup lang="ts">
import NavList from '@/components/NavList.vue'
import Item from '@/components/CardItem.vue'
</script>

<style lang="less" scoped>
.body {
  width: 100%;
  min-height: 100vh;
  vertical-align: baseline;
  word-wrap: break-word;
  color: #282a2d;
  background: #f9f9f9;
  transition: background-color 0.3s;
}
.page-container {
  display: table;
  width: 100%;
  height: 100%;
  vertical-align: top;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.text-hide {
  font: 0 / 0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

.logo-expanded {
  padding: 10px 15px;
  display: flex;
  overflow: hidden;
  align-items: center;
  .logo-content {
    margin-left: 10px;
    span {
      display: block;
      line-height: 22px;
      white-space: nowrap;
    }
    .logo-title {
      font-size: 24px;
      color: #fff;
    }
    .logo-sub-title {
      color: #fff;
      font-size: 14px;
    }
  }
}

.main-content {
  display: table-cell;
  position: relative;
  z-index: 1;
  padding: 30px;
  padding-bottom: 0;
  vertical-align: top;
  word-break: break-word;
  width: 100%;
  transition: opacity 100ms ease-in-out;
  .navbar {
    position: fixed;
    z-index: 2000 !important;
    width: calc(100% - 250px);
    padding: 0;
    background-color: transparent;
    .navbar-content {
      position: absolute;
      background: #fff;
      display: flex;
      width: 100%;
      box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
      padding-bottom: 1px;
      justify-content: space-between;
      align-items: center;
      .user-info-navbar .user-info-menu li {
        line-height: 1;
        display: table-cell;
        text-align: center;
        vertical-align: middle;
        a {
          padding: 31px 10px;
          padding-left: 20px;
        }
      }
    }
  }
}
.sidebar-nav {
  width: 220px;
  background: #f0f2f4;
  height: 100vh;
  z-index: 1081;
  opacity: 1 !important;
  position: fixed;
  display: table-cell;
  font-size: 0.875rem;
}

.sidebar-scroll {
}

.sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1080;
}

@media (min-width: 768px) {
  .sidebar-nav {
    display: block !important;
  }
}

.h-100 {
  height: 100% !important;
}

.sidebar-nav-inner {
  width: inherit;
  margin: 0;
  max-width: 220px;
  background: #2c2e2f;
  pointer-events: inherit;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s;
}

.sidebar-logo {
  background: #2c2e2f;
  height: 74px;
  transition: background-color 0.2s;
  .logo {
    img {
      max-height: 55px;
    }
  }
}
.no-search {
  margin-top: 75px;
}
.position-absolute {
  position: absolute !important;
}

.text-hide {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

.overflow-hidden {
  overflow: hidden !important;
}

.sidebar-nav .logo {
  line-height: 74px;
  width: 100%;
  text-align: center;
}

.border-bottom {
  border-bottom: 1px solid #313437 !important;
}

.sidebar-menu {
  transition: all 0.3s;
  display: table-cell;
  position: relative;
  width: 220px;
  background: #2c2e2f;
  z-index: 1;
}

.fixed {
  height: 100%;
}

.flex-fill {
  flex: 1 1 auto !important;
  overflow-y: auto;
  overflow-x: hidden;
}

sidebar-nav-inner .flex-fill {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.sidebar-item {
  position: relative;
  display: block;
}

sidebar-menu ul:first-child > li > a {
  padding: 12px 10px;
}

.sidebar-nav .flex-bottom a {
  display: flex;
  overflow: hidden;
  padding: 8px 10px;
  margin: 1.5px 8px;
  color: #b2b8be;
  align-items: center;
  white-space: nowrap;
  transition: all 0.3s;
}

.icon-fw {
  text-align: center;
  width: 1.25em;
}

@media only screen and (min-device-width: 768px) {
  ::-webkit-scrollbar-thumb {
    background-color: rgba(130, 130, 130, 0.5);
    -webkit-border-radius: 4px;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: #f1404b;
    -webkit-border-radius: 4px;
    border-radius: 4px;
  }

  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

  ::-webkit-scrollbar-thumb:active {
    background-color: #f1404b;
    -webkit-border-radius: 4px;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0);
    border-radius: 0 0 8px 0;
  }

  ::-webkit-scrollbar-button {
    background-color: rgba(0, 0, 0, 0);
    height: 2px;
    width: 2px;
  }
}

@media (max-width: 767.98px) {
  .tab-auto-scrollbar::-webkit-scrollbar {
    display: none;
  }
}
</style>